miscellaneous exercise of matrices